Skip to content

test(rds): wait for db instance available before chaining ops#821

Closed
vieiralucas wants to merge 1 commit intomainfrom
worktree-fix-rds-conformance-async-create
Closed

test(rds): wait for db instance available before chaining ops#821
vieiralucas wants to merge 1 commit intomainfrom
worktree-fix-rds-conformance-async-create

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Apr 28, 2026

Summary

Conformance has been failing on main since the async CreateDBInstance work landed (`v0.13.1 deferred RDS shipped`, 2026-04-28). `CreateDBInstance` returns immediately with `status="creating"` and the real postgres container starts in a background task, but 10 RDS conformance tests were running follow-up ops (snapshot, reboot, modify, replica, restore, delete-with-final-snapshot) against a still-`creating` instance and either erroring or observing intermediate state.

Adds `wait_for_db_instance_available` polling helper and wires it into the `create_instance` test helper plus the three inline-create tests so all chained ops see an `available` instance.

Test plan

  • All 10 affected tests now have a wait barrier before the followup op:
    • `rds_describe_db_instances`
    • `rds_create_db_snapshot`
    • `rds_describe_db_snapshots`
    • `rds_delete_db_snapshot`
    • `rds_describe_db_snapshots_pagination`
    • `rds_reboot_db_instance`
    • `rds_modify_db_instance_with_apply_immediately_false`
    • `rds_create_db_instance_read_replica`
    • `rds_restore_db_instance_from_db_snapshot`
    • `rds_delete_db_instance_with_final_snapshot`
  • Tests that intentionally observe `creating` (`rds_create_db_instance`) bypass the helper and stay unaffected.
  • Tests that observe `modifying` / `deleting` (`rds_modify_db_instance`, `rds_delete_db_instance`) still pass — they go through the wait helper, then the next op produces the expected transitional state.
  • CI conformance job green.

Summary by cubic

Fixes RDS conformance failures by waiting for a DB instance to be "available" before chaining follow-up operations in tests.

  • Bug Fixes
    • Added wait_for_db_instance_available helper (polls every 250ms, 60s timeout via DescribeDBInstances).
    • Wired into the create-instance test helper and added inline waits in tests that create instances directly, so snapshot, reboot, modify, replica, restore, and delete-with-final-snapshot run against an available instance.
    • Tests that assert "creating", "modifying", or "deleting" states remain unchanged.

Written for commit 5f7c3eb. Summary will update on new commits. Review in cubic

CreateDBInstance is async (returns immediately with status="creating"
and the postgres container starts in a background task). Conformance
tests that chain operations on the new instance — CreateDBSnapshot,
RebootDBInstance, ModifyDBInstance with apply_immediately, read
replica creation, restore from snapshot, delete with final snapshot —
were running against a "creating" instance and either erroring or
observing intermediate state. 10 RDS tests have been failing on main
since the async work landed.

Adds wait_for_db_instance_available helper that polls
DescribeDBInstances every 250ms (60s timeout) until status is
"available". Wires it into the create_instance helper so every test
that uses it gets a ready instance, and adds inline waits in the
three tests that build the instance manually instead of going through
the helper.

Tests covered: rds_describe_db_instances, rds_create_db_snapshot,
rds_describe_db_snapshots, rds_delete_db_snapshot,
rds_describe_db_snapshots_pagination, rds_reboot_db_instance,
rds_modify_db_instance_with_apply_immediately_false,
rds_create_db_instance_read_replica,
rds_restore_db_instance_from_db_snapshot,
rds_delete_db_instance_with_final_snapshot.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@vieiralucas vieiralucas force-pushed the worktree-fix-rds-conformance-async-create branch from f6707e1 to 5f7c3eb Compare April 28, 2026 13:47
@vieiralucas
Copy link
Copy Markdown
Member Author

Closing as duplicate. The RDS conformance regression from async CreateDBInstance was independently fixed and shipped via 738abf5 (fix(rds): accept short engine_version majors for mysql/mariadb/postgres), which added the same wait_for_db_available helper plus a service-side validator fix for short engine-version majors. No further action needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant